@echo off

if NOT DEFINED IIP_DB_NAME set IIP_DB_NAME=Clients_Mus
if NOT DEFINED IIP_DB_LOCATION set IIP_DB_LOCATION=E:\DATA


GOTO CASE_%1%

:CASE_
 echo Select one of the options [START] [RUN] [BACKUP] [UPDATEDATABASE]
	GOTO END_SWITCH

:CASE_UPDATEDATABASE
	InvestmentIntelligence.TaskRunner.exe -t AppConfigConfiguredCompositeTask --file-name TaskCongurations\Mus-Release --task-name UpdateDataBase --force-all || goto :fail
	GOTO END_SWITCH

:CASE_START
	InvestmentIntelligence.TaskRunner.exe -t AppConfigConfiguredCompositeTask --file-name TaskCongurations\Mus-Release --task-name Start --force-all || goto :fail
	GOTO END_SWITCH

:CASE_RUN
	InvestmentIntelligence.TaskRunner.exe -t AppConfigConfiguredCompositeTask --file-name TaskCongurations\Mus-Release --task-name Run || goto :fail
	if %2.==/backupfiles. (
	GOTO CASE_BACKUP 
	)
    GOTO END_SWITCH
	
:CASE_BACKUP
	InvestmentIntelligence.TaskRunner.exe -t AppConfigConfiguredCompositeTask --file-name TaskCongurations\Mus-Release --task-name BackUp || goto :fail
    GOTO END_SWITCH

:END_SWITCH
	exit /b 1

:fail
echo FAILED
exit /b 1